package cn.com.aiouyi.shiro;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;

/**
 * shiro工具类  获取用户相关信息
 * @author hanson
 *
 */
public class ShiroUtils {
	
	/**
	 * 获取当前登录的认证实体
	 * @return
	 */
	public static Principal getPrincipal() {
		Subject subject = SecurityUtils.getSubject();
		return (Principal)subject.getPrincipal();
	}
	
}
